package com.ttg.web.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttg.common.enums.OrganOpenStatusEnum;
import com.ttg.model.mapper.OrganOpenMapper;
import com.ttg.model.pojo.OrganOpen;
import com.ttg.web.service.OrganOpenService;
import org.springframework.stereotype.Service;

/**
 * @author ZQ
 * @version 1.0
 * @Description
 * @date 2021/1/18 17:21
 */
@Service
public class OrganOpenServiceImpl extends ServiceImpl<OrganOpenMapper, OrganOpen> implements OrganOpenService {
    @Override
    public OrganOpen getByOpenIdAndStatus(String ogoOpenId, OrganOpenStatusEnum statusEnum) {
        LambdaQueryWrapper<OrganOpen> wrapper = new LambdaQueryWrapper<OrganOpen>();
        wrapper.eq(OrganOpen::getOgoOpenId, ogoOpenId)
                .eq(OrganOpen::getOgoStatus,statusEnum.getValue());
        return getOne(wrapper);
    }
}
